package helloworld;

import helloworld.dao.demo2Dao;
import helloworld.dao.demoDao;
import helloworld.model.demo;
import helloworld.model.demo2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by admin on 2016/11/8.
 */
@RestController
@PreAuthorize("hasRole('ROLE_ADMIN')")
public class GreetingController {
    @Autowired
    demoDao my_demoDao;
    @Autowired
    demo2Dao my_demo2Dao;
    @RequestMapping("/hello")
    public String greeting()
    {
        demo2 temp=new demo2();
        demo t=my_demoDao.findOne(2);
        //temp.setMy_demo(t);
        //my_demo2Dao.save(temp);
        return "greeting";
    }
}
